import Vue from 'vue'
import locale from 'element-ui/lib/locale';
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import en from './langs/en/index'
import cn from './langs/cn/index'
Vue.use(VueI18n)
// ...enLocale // 或者用 Object.assign({ message: 'hello' }, enLocale)
const messages = {
  en: Object.assign(en, enLocale),
  cn: Object.assign(cn, zhLocale)
}

const i18n = new VueI18n({
  locale: 'cn',
  messages
})
locale.i18n((key, value) => i18n.t(key, value)) //为了实现element插件的多语言切换

export default i18n

